package com.hefei.garden.controller;

import com.hefei.garden.config.annotation.PreventMultipleClick;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;

/**
 * @author: devil
 * @Date: 2022/7/21 20
 * @Description:
 */
@RequestMapping("/preventBrush")
@Controller
public class PreventBrushController {

    /**
     * 测试防刷
     *
     * @return
     */
    @ResponseBody
    @GetMapping(value = "/testPrevent")
    @PreventMultipleClick
    public String testPrevent(@RequestParam("str") String string) {
        return "调用成功";
    }

    /**
     * 测试防刷
     *
     * @return
     */
    @ResponseBody
    @GetMapping(value = "/testPreventIncludeMessage")
    @PreventMultipleClick(message = "10秒内不允许重复调多次", value = "10")
    public String testPreventIncludeMessage(@RequestParam("str") String string) {
        return "调用成功";
    }

    @ResponseBody
    @GetMapping(value = "/testPreventTest")
    public String testPreventTest() {
        return "调用成功";
    }


}
